package com.lhg.pattern.creational.singleton;

/**
 * 恶汉式加载
 *
 * @author Admin
 */
public class Singleton3 {
    /**
     *类加载的时候初始化，浪费内存
     */
    private static Singleton3 instance=new Singleton3();

    public Singleton3() {
    }
    public static  Singleton3 getInstance() {
        return instance;
    }
    public void showMessage(){
        System.out.println("Hello World!");
    }
}
